import 'package:flutter/material.dart';

import 'package:get/get.dart';
import 'package:word_app/app/modules/model/screen_adapter.dart';

import '../controllers/change_password_controller.dart';

class ChangePasswordView extends GetView<ChangePasswordController> {
  const ChangePasswordView({super.key});
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        decoration: const BoxDecoration(
            gradient: LinearGradient(
                begin: Alignment.topCenter,
                end: Alignment.bottomCenter,
                colors: [
              Color.fromARGB(255, 198, 216, 241),
              Color.fromARGB(255, 255, 255, 255)
            ])),
        padding: EdgeInsets.only(
            top: ScreenAdapterModel.getStatusBarHeight() + 10,
            left: 20,
            right: 20),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.start,
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Container(
              width: 25,
              height: 25,
              child: InkWell(
                  child: Image.asset(
                "images/back.png",
              )),
            ),
            const SizedBox(height: 20),
            const Text(
              "您正在修改该聊天号的密码",
              style: TextStyle(
                  color: Color.fromARGB(255, 110, 113, 130), fontSize: 18),
            ),
            Text(
              controller.numberStr.value,
              style: const TextStyle(
                  color: Colors.black, fontWeight: FontWeight.bold),
            ),
            const SizedBox(height: 30),
            const Text("设置新密码",
                style: TextStyle(
                    color: Color.fromARGB(255, 110, 113, 130), fontSize: 18)),
            TextField(
              controller: controller.vc,
              decoration: const InputDecoration(
                  hintText: "请输入4 - 6位数字密码",
                  filled: true,
                  fillColor: Color.fromARGB(255, 246, 246, 246),
                  border: InputBorder.none),
            ),
            const SizedBox(height: 30),
            const Text("设置新再次输入",
                style: TextStyle(
                    color: Color.fromARGB(255, 110, 113, 130), fontSize: 18)),
            TextField(
              controller: controller.vc1,
              decoration: const InputDecoration(
                  hintText: "请输入4 - 6位数字密码",
                  filled: true,
                  fillColor: Color.fromARGB(255, 246, 246, 246),
                  border: InputBorder.none),
            ),
            InkWell(
                onTap: () {
                  controller.editPassworld(context);
                },
                child: Container(
                  margin: const EdgeInsets.only(top: 50),
                  alignment: Alignment.center,
                  height: ScreenAdapterModel.width(160),
                  decoration: BoxDecoration(
                      borderRadius:
                          BorderRadius.circular(ScreenAdapterModel.width(80)),
                      color: const Color.fromARGB(255, 112, 128, 255)),
                  child: const Text(
                    "立即修改",
                    textAlign: TextAlign.center,
                    style: TextStyle(
                        color: Colors.white,
                        fontWeight: FontWeight.bold,
                        fontSize: 18),
                  ),
                ))
          ],
        ),
      ),
    );
  }
}
